package org.itboys.shop.member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.itboys.framework.spring.controller.BaseController;
import org.itboys.fuzion.service.MemberTwoCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
/**
 * 大乱斗微信相关
 * @author weisky
 *
 * 2016年4月14日
 */
@RestController 
@RequestMapping("/fuzion/weixin") 
public class FuzionTwoCodeController extends BaseController{

	@Autowired
	private MemberTwoCodeService memberTwoCodeService;
	
	/**
	 * 分享的二维码页面
	 * @param paramId
	 * @param model
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("/createMyWeixinTwoCode") 
	public ModelAndView createMyWeixinTwoCode(Long paramId, Model model,
			HttpServletRequest request, HttpServletResponse response){
		String twocode = memberTwoCodeService.createMemberTwoCodeSaveSer(paramId);
		model.addAttribute("twoCodeUrl", twocode);//二维码地址
		
		return new ModelAndView("/site/twocode");
	}
}
